//package com.luocx.weixinproject.servlet;
//
//import java.io.IOException;
//import java.io.PrintWriter;
//
//import javax.servlet.ServletException;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
//import com.luocx.weixinproject.util.CheckUtil;
//
//public class WeixinServlet extends HttpServlet {
//
//	private static final long serialVersionUID = 1L;
//
//	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//
//		// 接收微信服务器以Get请求发送的4个参数
//		String signature = request.getParameter("signature");
//		String timestamp = request.getParameter("timestamp");
//		String nonce = request.getParameter("nonce");
//		String echostr = request.getParameter("echostr");
//
//		PrintWriter out = response.getWriter();
//		if (CheckUtil.checkSignature(signature, timestamp, nonce)) {
//			out.print(echostr); // 校验通过，原样返回echostr参数内容
//		}
//	}
//
//	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//		doGet(request, response);
//	}
//}
